//设置滚动条高度
const setScroll = (dom) => {
    if(dom){
        let top = 0
        let scrollTops = dom.scrollTop
        let timer = setInterval(() => {
            top += 10
            dom.scrollTop = scrollTops + top
            if(top >=300){
                clearInterval(timer)
            }
        }, 10);
    }
}
//输入的时间格式为yyyy-MM-dd hh:mm:ss
function dateFormat(dateStr) { 
    if(dateStr){
        let str = dateStr.split(' ')[0].split('-')
        return new Date(str[0], str[1] - 1, str[2])
    }
}
export {
    setScroll,
    dateFormat
}